package com.wyg.protocol;

import java.util.Arrays;

/**
 * @description:
 * @author: WYG
 * @time: 2020/10/24 12:27
 */

public class RPCRequest {
    private String requestId;
    private String interfaceName;
    private String methodName;
    private Class<?>[] paramsTypes;
    private Object[] params;

    public RPCRequest(String requestId, String interfaceName, String methodName,
                      Class<?>[] paramsTypes, Object[] params) {
        this.requestId = requestId;
        this.interfaceName = interfaceName;
        this.methodName = methodName;
        this.paramsTypes = paramsTypes;
        this.params = params;
    }

    public RPCRequest() {}

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getInterfaceName() {
        return interfaceName;
    }

    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Class<?>[] getParamsTypes() {
        return paramsTypes;
    }

    public void setParamsTypes(Class<?>[] paramsTypes) {
        this.paramsTypes = paramsTypes;
    }

    public Object[] getParams() {
        return params;
    }

    public void setParams(Object[] params) {
        this.params = params;
    }

    @Override
    public String toString() {
        return "RPCRequest{" +
                "requestId=" + requestId +
                ", interfaceName='" + interfaceName + '\'' +
                ", methodName='" + methodName + '\'' +
                ", paramsTypes=" + paramsTypes +
                ", params=" + Arrays.toString(params) +
                '}';
    }
}
